]> dgit.raspbian.org Git - gnome-shell.git/commit
iconGrid: Eliminate JavaScript for painting/picking
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Fri, 23 Nov 2018 08:43:34 +0000 (16:43 +0800)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 27 Nov 2018 13:25:37 +0000 (13:25 +0000)
commit0e0574a0b448a28235ec056f2397c4568f5c9338
tree953abff79bd866fc61cc4ef77e07747c3c8b7f0e
parent4c11d15a074aeca72627c44e327e2dc2afa93ae3
iconGrid: Eliminate JavaScript for painting/picking

The only reason for `vfunc_paint` and `vfunc_pick` existing was to
implement a culling optimization. Although that optimization actually
made performance worse than none at all because it forced the painting
and picking cycles to spend more time calling into JavaScript.

Turns out we don't have to choose between native code and culling though.
Just reimplement the culling using native ClutterActor functions and we
get the benefits of both.

Performance on an i7-7700:

Moving the cursor over the icon grid:
Before: 70% CPU, 5.5ms per frame
After : 60% CPU, 4.5ms per frame

Scrolling the icon grid:
Before: 60% CPU, 4.4ms per frame
After : 50% CPU, 3.3ms per frame

Helps with https://gitlab.gnome.org/GNOME/gnome-shell/issues/174
js/ui/iconGrid.js